FROM mcr.microsoft.com/dotnet/sdk:3.1 as build-env
WORKDIR /code

COPY *.csproj /code/
RUN dotnet restore

COPY . /code/
RUN dotnet publish -c Release -o out    

FROM mcr.microsoft.com/dotnet/aspnet:3.1
WORKDIR  /app
COPY --from=build-env /code/out /app/
EXPOSE 5001
ENTRYPOINT ["dotnet","User.API.dll"]